import os
import sys
import time
import json
import shutil
import fnmatch
import tarfile
import zipfile

# filename = "D:\WorkDir\Documents\Scripts\DownloadImage\store\ohos-sdk.tar.gz"
# with tarfile.open(filename, 'r') as t:
#     file_direct = set([ item.split('/')[0] for item in t.getnames()])
#     print(len(file_direct))
#     print(t.getnames())

# filename = "D:\WorkDir\Documents\Scripts\DownloadImage\store\ohos-sdk\ohos-sdk\windows\ets-windows-x64-4.0.5.5-Canary1.zip"
# with zipfile.ZipFile(filename) as zip_file:
#     file_direct = list(set([ item.split('/')[0] for item in zip_file.namelist()])) #[ item for item in zip_file.namelist() if '/' not in item ]
#     print(file_direct[0])
#     # print(zip_file.infolist())

filename = "D:\WorkDir\Documents\Scripts\DownloadImage\store\ohos-sdk\ohos-sdk\windows"
l1 = os.path.split(filename)
print(l1)